function getCaptcha(obj) {
    if(!$(".yz_btn").hasClass("grey")){
        var mobile = $("#mobile").val();
        if (!checkMobile(mobile)) {
            alert("请输入正确的手机号");
            return;
        }

        $.ajax({
            url: 'getSMSVerificationCode',
            type: 'post',
            data: {mobile: mobile},
            dataType: 'json',
            error: function () {
                $(".yz_btn").addClass("grey");
                alert('验证码已发送！');
                return false;
            },
            success: function(resp) {
                $(".yz_btn").addClass("grey");
                alert('验证码已发送！');
            }
        });
    }else{
        alert("验证码已发送，请稍等！")
    }
}

function checkMobile(mobile){
    var reg = /^0?1[35789]{1}[0-9]\d{8}$/;
    return reg.test(mobile) ? true : false;
}

$(function() {
    $("ul.dropdown-menu").on("click", "[data-stopPropagation]", function(e) {
        e.stopPropagation();
    });
});

function sum(list){
    return eval(list.join("+"));
}